﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AMS.DeDuplicator.BusinessLayer.Command;
using AMS.DeDuplicator.CommonLayer;

namespace AMS.DeDuplicator.ApplicationLayer.State
{
    public class Transition
    {
        IState _nextState;
        Command _command;

        public Transition(IState nextState, Command command)
        {
            InputValidator.ValidateNotNull(nextState);
            _nextState = nextState;
            _command = command;
        }

        public IState ExecuteTransition()
        {
            if (_command != null)
                _command.Execute();

            return _nextState;
        }
    }
}
